package com.mask.im.business.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("用户账户实体")
@TableName("sys_user_auth")
public class UserAuth {
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty("用户账户实体Id")
    private Integer id;

    @ApiModelProperty(value = "账号", required = true)
    private String username;

    @ApiModelProperty(value = "手机号", required = true)
    private String phone;

    @ApiModelProperty(value = "密码", required = true)
    private String password;

    @ApiModelProperty("关联userInfo的id")
    private Long userInfoId;

    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("登入类型")
    private Integer loginType;

    @ApiModelProperty("ip")
    private String ipAddress;

    @ApiModelProperty("位置")
    private String ipSource;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)

    private Date updateTime;

    @ApiModelProperty("最后登入时间")
    private Date lastLoginTime;
}
